home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Views / Canvas Loops / CanvasColumnLoop.h < prev    next >
Text File  |  2000-06-23  |  1KB  |  41 lines

  1. // CanvasColumnLoop.h
  2.  
  3. #ifndef CanvasColumnLoop_h
  4. #define CanvasColumnLoop_h
  5.  
  6. #ifndef CanvasMaintainer_h
  7. #include "CanvasMaintainer.h"
  8. #endif
  9. #ifndef Canvas_h
  10. #include "Canvas.h"
  11. #endif
  12.  
  13. /*
  14.     This object can't screen out invisible columns, because it doesn't
  15.     know the column heights, and because you may want to do some work
  16.     on invisible columns, like keeping other variables in sync.
  17. */
  18.  
  19. class CanvasColumnLoop
  20.   {
  21.     private:
  22.         const Canvas& parent;
  23.         Range32 column;
  24.         Canvas canvas;
  25.         CanvasMaintainer canvasMaintainer;
  26.         
  27.     public:
  28.         CanvasColumnLoop( const Canvas&, Range32 firstColumn );
  29.         
  30.         bool Finished() const                                { return column.Start() >= parent.OffScreen().right; }
  31.         bool Unfinished() const                                { return column.Start() < parent.OffScreen().right; }
  32.         
  33.         void NextColumn( uint32 width );
  34.         void Remainder()                                        { NextColumn( maxint32 - column.End() ); }
  35.         
  36.         const Canvas *operator->() const                    { return &canvas; }
  37.         const Canvas& operator*() const                    { return canvas; }
  38.   };
  39.  
  40. #endif
  41.